package io.gitee.chearnee.fw.openapi.constant.enums;

import io.gitee.chearnee.fw.common.model.IBaseEnum;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * @author cn
 * @version 1.0
 * @description
 * @date 2021/9/17 20:10
 */
@RequiredArgsConstructor
@Getter
public enum ResultCode implements IBaseEnum<Integer> {
  /**
   * 系统繁忙，此时请开发者稍候再试
   */
  SYSTEM_ERROR(-1, "system busy"),
  /**
   * 请求成功
   */
  SUCCESS(0, "success"),

  /**
   * 通用失败
   */
  FAILED(500, "failed"),
  /**
   * 未找到此appId
   */
  NOT_FOUND(40001, "not found"),
  /**
   * 缺失xxx参数
   */
  MISSING_PARAMETER(40002, "missing parameter"),
  /**
   * 不合法的凭证类型
   */
  ILLEGAL_CERTIFICATE(40003, "illegal certificate"),
  /**
   * 验签错误
   */
  SIGN_VERIFICATION_FAILED(40004, "sign verification failed"),
  /**
   * 参数格式有误
   */
  PARAMETER_FAILED(40005, "parameter failed"),
  /**
   * accessToken不合法
   */
  ACCESS_TOKEN_FAILED(40006, "access token failed"),
  /**
   * 没有权限
   */
  PERMISSION_DENIED(40007, "permission denied"),
  /**
   * 此接口已超出调用频次
   */
  REQUEST_LIMIT(40008, "request limit"),
  /**
   * 重复请求
   */
  REQUEST_REPEATED(40009, "request repeated"),
  /**
   * 当前请求过期
   */
  REQUEST_EXPIRED(40010, "request expired"),
  /**
   * 当前ip不允许
   */
  IP_LIMIT(40011, "ip limit"),
  ;
  private final Integer value;
  private final String desc;
}
